package com.party.alipay;

import org.springframework.context.annotation.Configuration;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * 
 * @author Caizhf
 * @date 2017年7月23日下午3:07:39
 * @version v.0.1
 * @email 1115054416@qq.com
 *
 *        <p>
 * 			Description: 支付宝配置
 *        </p>
 *
 */
@Configuration
public class AlipayConfig {
	// 商户appid
	public static final String appId = "2015102500539847";
	
	// 私钥 pkcs8格式的
	public static final String RSA_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCO91ZU2TOxR4z4yjdSP0IKLLnsIGAVrxET+5fAuZmphhFE38mBYCu+efQ1zIQfhdXM3yIqb+N5QbwE8oQhr/fAWGsM4pny8lohtp1grwILx4zphSVE74lXIqVn6p8am0NV2xFQKhsJBRzvY5pNIW7OLQAJqdZPispAJNRHiO5hMjyBztohqymeRdCAYc8iJOQZpJntoGWKSOehvzboVfpOMa31IyBrwvDf61DkEpo2bNG67V1K8Bb2HJdGaAN15cIslvwSrlV2hbKROxQB0pB1h2X9xFimcjrG4RhN2ULkfmtZxWbxDcmosA7uoCdC7i9SZ9nZ0QZA+vgfAUaeDnT3AgMBAAECggEAQ1HcaR/N45CZpR0zZ5s58aiV88Za+FrzY8F499ttrBHhV9k4/Z7Xel3azOp83Isc3dfEMs91AcgeTQYVifdeZkg8QFkDvQ65ul5PRROjlwBkLiHwJsHUnh9GW+Ry/whVcLwzLthk2p55vY/dPKydjKBMAEDlFZd5HTM6cmTcOw++QCfmuZ94FbcL+R6KNSu3jYDW18zYDzzQyXTVMYyIZs34c+NzJ9WrwNzEiZZ51D7OhIv/Et4sxL1KmEE5cFVcG11o3YYb8rHfiyFS+YKUZQFNW35EttE2K8FY4gHYZNiWpbDdOQswkYp4EoS3dnyFbc5N4ydtaZtHOPCYrYtBAQKBgQD5Tub5BwNm/n5ewVznGGEwrW2h6mu2ImohOTRBxubOCQ99CvlVvBADRD7l0n05muwuHXe13zU3VXZAbeC6jwlzZE0L1+cAMPs6o9lFWveBnpF9Ks/N91qYasRAejvWoNQsWWXUh4FZ9cW3jkJ/4T3UU7z72Eg6nPUm3MIi+9QqFwKBgQCSzbc13yy9cBqEsRhS0hGjwCmG9Ky0v1S8u8iFhPdei+QuC62Q2xgjE59dtb5cs9pXM7hz5f7mX10LpG8dOKGa3OpfO4zjHlZ0Gl6rsABFwnChaNeJ8ee2B16az2DP/MemT8g8wOFm/8XtWfSENxVLz68M+tIXDhmnSBaTxYA4IQKBgQCf9yum0AQz2sm0/PciZPc/p5f305WHSS+136GTLw+7Vf71KcxwYXoYznpZNqUZCDnRISFFtlHMDm8Qyi/vJIZY3xu8pKzY55TbvHRV1xeGuPr7SDQMIVGlCKSiBoxMm+doCXiYVNX/pf5WV9Z9fUYR7iUNp2o5CasXY4DBt7obwwKBgDgYueCxFjSRaOC5l3TWZv0uye+TAYfT8Pppu1ciFzCeviPGPJ20ywVkUyqI72QXKeDWl65Z/cxkNnbjb743zLETp8+aPtzu09Rr2y86AvClO0rCeFJzCLrrGACKLBFuI5BuvjJQ9hDYvfZTwHbhYZbllpucILnEnpLong/7kWJhAoGBAJ3Ttmv4zSLXlFH1ZmqS6a2fsYZ01OQThxgfov0KwvL/fvF9+N53TqYfq+4IF6hl3YRqpye3m792Z+Qr20OcoBuNmbrVpNUeoesqrl/QefCZaCTblTba2KTbE0lehESprNG+pk5+DNv94KZVTZp/DbxGApiX+J+HqLoRR9HQgoEb";
	// 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://www.huanju100.cn/orders/ali_notify.do";

	// 页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	// "http://商户网关地址/alipay.trade.wap.pay-JAVA-UTF-8/return_url.jsp"
	// 商户可以自定义同步跳转地址
	public static String return_url = "http://www.huanju100.cn/orders/ali_return.do";

	// 支付宝请求网关地址
	public static final String URL = "https://openapi.alipay.com/gateway.do";

	// 编码
	public static final String CHARSET = "UTF-8";

	// 返回格式
	public static String FORMAT = "json";

	// 支付宝公钥
	public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlJ7ijSDinmSAv5cjI967CnjyX5Kmp72MHEKdOeIcPTyVzOQzOk9NIHSqkgZUMEDZzQGPOJbEcyowDsv/aML+L+Ixd8Wcey9/LdtOnURKP9sxgj1A+M00uiJpg8TrE1hjWkgzxLz4qGtqyRdtHiAxdk9kca/tLPyjpC+GUT24NwNW2sWZnIi5FDzuXHL3bNjwO/twAg8GbBPWCDUogK/2nlEUAl/cEwV3/qqIk4NHcmg4bNwp9XRQ41i1k4b714CpNAGq7aCsP61XLZ+zlDBkmr8GqD3tUaQbPnAAJngkuzMRF6bLo6ZgMQaUfSKhwJskAhYJjh8d/oeiTtOZ6BVIOQIDAQAB";

	// RSA2
	public static String SIGN_TYPE = "RSA2";
	
	public static final String PRODUCT_CODE= "QUICK_WAP_PAY";

	private static AlipayClient alipayClient;
	
	static {
		alipayClient = new DefaultAlipayClient(URL, appId, RSA_PRIVATE_KEY, FORMAT, CHARSET, ALIPAY_PUBLIC_KEY,
				SIGN_TYPE);
	}

	public static AlipayClient getAliPayClient() {
		return alipayClient;
	}

}
